home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Freeware / NSIS 2.29 / nsis-2.29-setup.exe / Include / WordFunc.nsh < prev    next >
Encoding:
Text File  |  2006-06-01  |  42.6 KB  |  2,206 lines

  1. /*
  2. _____________________________________________________________________________
  3.  
  4.                        Word Functions Header v3.3
  5. _____________________________________________________________________________
  6.  
  7.  2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
  8.  
  9.  See documentation for more information about the following functions.
  10.  
  11.  Usage in script:
  12.  1. !include "WordFunc.nsh"
  13.  2. !insertmacro WordFunction
  14.  3. [Section|Function]
  15.       ${WordFunction} "Param1" "Param2" "..." $var
  16.     [SectionEnd|FunctionEnd]
  17.  
  18.  
  19.  WordFunction=[WordFind|WordFindS|WordFind2X|WordFind2XS|WordFind3X|WordFind3XS|
  20.                WordReplace|WordReplaceS|WordAdd|WordAddS|WordInsert|WordInsertS|
  21.                StrFilter|StrFilterS|VersionCompare|VersionConvert]
  22.  
  23.  un.WordFunction=[un.WordFind|un.WordFindS|un.WordFind2X|un.WordFind2XS|
  24.                   un.WordFind3X|un.WordFind3XS|un.WordReplace|un.WordReplaceS|
  25.                   un.WordAdd|un.WordAddS|un.WordInsert|un.WordInsertS|
  26.                   un.StrFilter|un.StrFilterS|un.VersionCompare|un.VersionConvert]
  27.  
  28. _____________________________________________________________________________
  29.  
  30.                        Thanks to:
  31. _____________________________________________________________________________
  32.  
  33. WordFind3X
  34.     Afrow UK (Based on his idea of Function "StrSortLR")
  35. StrFilter
  36.     sunjammer (Function "StrUpper")
  37. VersionCompare
  38.     Afrow UK (Based on his Function "VersionCheckNew2")
  39. VersionConvert
  40.     Afrow UK (Based on his idea of Function "CharIndexReplace")
  41. */
  42.  
  43.  
  44. ;_____________________________________________________________________________
  45. ;
  46. ;                         Macros
  47. ;_____________________________________________________________________________
  48. ;
  49. ; Change log window verbosity (default: 3=no script)
  50. ;
  51. ; Example:
  52. ; !include "WordFunc.nsh"
  53. ; !insertmacro WordFind
  54. ; ${WORDFUNC_VERBOSE} 4   # all verbosity
  55. ; !insertmacro WordReplace
  56. ; ${WORDFUNC_VERBOSE} 3   # no script
  57.  
  58. !ifndef WORDFUNC_INCLUDED
  59. !define WORDFUNC_INCLUDED
  60.  
  61. !verbose push
  62. !verbose 3
  63. !ifndef _WORDFUNC_VERBOSE
  64.     !define _WORDFUNC_VERBOSE 3
  65. !endif
  66. !verbose ${_WORDFUNC_VERBOSE}
  67. !define WORDFUNC_VERBOSE `!insertmacro WORDFUNC_VERBOSE`
  68. !define _WORDFUNC_UN
  69. !define _WORDFUNC_S
  70. !verbose pop
  71.  
  72. !macro WORDFUNC_VERBOSE _VERBOSE
  73.     !verbose push
  74.     !verbose 3
  75.     !undef _WORDFUNC_VERBOSE
  76.     !define _WORDFUNC_VERBOSE ${_VERBOSE}
  77.     !verbose pop
  78. !macroend
  79.  
  80.  
  81. # Install. Case insensitive. #
  82.  
  83. !macro WordFindCall _STRING _DELIMITER _OPTION _RESULT
  84.     !verbose push
  85.     !verbose ${_WORDFUNC_VERBOSE}
  86.     Push `${_STRING}`
  87.     Push `${_DELIMITER}`
  88.     Push `${_OPTION}`
  89.     Call WordFind
  90.     Pop ${_RESULT}
  91.     !verbose pop
  92. !macroend
  93.  
  94. !macro WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  95.     !verbose push
  96.     !verbose ${_WORDFUNC_VERBOSE}
  97.     Push `${_STRING}`
  98.     Push `${_DELIMITER1}`
  99.     Push `${_DELIMITER2}`
  100.     Push `${_NUMBER}`
  101.     Call WordFind2X
  102.     Pop ${_RESULT}
  103.     !verbose pop
  104. !macroend
  105.  
  106. !macro WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  107.     !verbose push
  108.     !verbose ${_WORDFUNC_VERBOSE}
  109.     Push `${_STRING}`
  110.     Push `${_DELIMITER1}`
  111.     Push `${_CENTER}`
  112.     Push `${_DELIMITER2}`
  113.     Push `${_NUMBER}`
  114.     Call WordFind3X
  115.     Pop ${_RESULT}
  116.     !verbose pop
  117. !macroend
  118.  
  119. !macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  120.     !verbose push
  121.     !verbose ${_WORDFUNC_VERBOSE}
  122.     Push `${_STRING}`
  123.     Push `${_WORD1}`
  124.     Push `${_WORD2}`
  125.     Push `${_NUMBER}`
  126.     Call WordReplace
  127.     Pop ${_RESULT}
  128.     !verbose pop
  129. !macroend
  130.  
  131. !macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
  132.     !verbose push
  133.     !verbose ${_WORDFUNC_VERBOSE}
  134.     Push `${_STRING1}`
  135.     Push `${_DELIMITER}`
  136.     Push `${_STRING2}`
  137.     Call WordAdd
  138.     Pop ${_RESULT}
  139.     !verbose pop
  140. !macroend
  141.  
  142. !macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  143.     !verbose push
  144.     !verbose ${_WORDFUNC_VERBOSE}
  145.     Push `${_STRING}`
  146.     Push `${_DELIMITER}`
  147.     Push `${_WORD}`
  148.     Push `${_NUMBER}`
  149.     Call WordInsert
  150.     Pop ${_RESULT}
  151.     !verbose pop
  152. !macroend
  153.  
  154. !macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  155.     !verbose push
  156.     !verbose ${_WORDFUNC_VERBOSE}
  157.     Push `${_STRING}`
  158.     Push `${_FILTER}`
  159.     Push `${_INCLUDE}`
  160.     Push `${_EXCLUDE}`
  161.     Call StrFilter
  162.     Pop ${_RESULT}
  163.     !verbose pop
  164. !macroend
  165.  
  166. !macro VersionCompareCall _VER1 _VER2 _RESULT
  167.     !verbose push
  168.     !verbose ${_WORDFUNC_VERBOSE}
  169.     Push `${_VER1}`
  170.     Push `${_VER2}`
  171.     Call VersionCompare
  172.     Pop ${_RESULT}
  173.     !verbose pop
  174. !macroend
  175.  
  176. !macro VersionConvertCall _VERSION _CHARLIST _RESULT
  177.     !verbose push
  178.     !verbose ${_WORDFUNC_VERBOSE}
  179.     Push `${_VERSION}`
  180.     Push `${_CHARLIST}`
  181.     Call VersionConvert
  182.     Pop ${_RESULT}
  183.     !verbose pop
  184. !macroend
  185.  
  186. !macro WordFind
  187.     !ifndef ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  188.         !verbose push
  189.         !verbose ${_WORDFUNC_VERBOSE}
  190.         !define ${_WORDFUNC_UN}WordFind${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}Call`
  191.  
  192.         Function ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  193.             Exch $1
  194.             Exch
  195.             Exch $0
  196.             Exch
  197.             Exch 2
  198.             Exch $R0
  199.             Exch 2
  200.             Push $2
  201.             Push $3
  202.             Push $4
  203.             Push $5
  204.             Push $6
  205.             Push $7
  206.             Push $8
  207.             Push $9
  208.             Push $R1
  209.             ClearErrors
  210.  
  211.             StrCpy $9 ''
  212.             StrCpy $2 $1 1
  213.             StrCpy $1 $1 '' 1
  214.             StrCmp $2 'E' 0 +3
  215.             StrCpy $9 E
  216.             goto -4
  217.  
  218.             StrCpy $3 ''
  219.             StrCmp${_WORDFUNC_S} $2 '+' +6
  220.             StrCmp${_WORDFUNC_S} $2 '-' +5
  221.             StrCmp${_WORDFUNC_S} $2 '/' restart
  222.             StrCmp${_WORDFUNC_S} $2 '#' restart
  223.             StrCmp${_WORDFUNC_S} $2 '*' restart
  224.             goto error3
  225.  
  226.             StrCpy $4 $1 1 -1
  227.             StrCmp${_WORDFUNC_S} $4 '*' +4
  228.             StrCmp${_WORDFUNC_S} $4 '}' +3
  229.             StrCmp${_WORDFUNC_S} $4 '{' +2
  230.             goto +4
  231.             StrCpy $1 $1 -1
  232.             StrCpy $3 '$4$3'
  233.             goto -7
  234.             StrCmp${_WORDFUNC_S} $3 '*' error3
  235.             StrCmp${_WORDFUNC_S} $3 '**' error3
  236.             StrCmp${_WORDFUNC_S} $3 '}{' error3
  237.             IntOp $1 $1 + 0
  238.             StrCmp${_WORDFUNC_S} $1 0 error2
  239.  
  240.             restart:
  241.             StrCmp${_WORDFUNC_S} $R0 '' error1
  242.             StrCpy $4 0
  243.             StrCpy $5 0
  244.             StrCpy $6 0
  245.             StrLen $7 $0
  246.             goto loop
  247.  
  248.             preloop:
  249.             IntOp $6 $6 + 1
  250.  
  251.             loop:
  252.             StrCpy $8 $R0 $7 $6
  253.             StrCmp${_WORDFUNC_S} $8$5 0 error1
  254.             StrCmp${_WORDFUNC_S} $8 '' +2
  255.             StrCmp${_WORDFUNC_S} $8 $0 +5 preloop
  256.             StrCmp${_WORDFUNC_S} $3 '{' minus
  257.             StrCmp${_WORDFUNC_S} $3 '}' minus
  258.             StrCmp${_WORDFUNC_S} $2 '*' minus
  259.             StrCmp${_WORDFUNC_S} $5 $6 minus +5
  260.             StrCmp${_WORDFUNC_S} $3 '{' +4
  261.             StrCmp${_WORDFUNC_S} $3 '}' +3
  262.             StrCmp${_WORDFUNC_S} $2 '*' +2
  263.             StrCmp${_WORDFUNC_S} $5 $6 nextword
  264.             IntOp $4 $4 + 1
  265.             StrCmp${_WORDFUNC_S} $2$4 +$1 plus
  266.             StrCmp${_WORDFUNC_S} $2 '/' 0 nextword
  267.             IntOp $8 $6 - $5
  268.             StrCpy $8 $R0 $8 $5
  269.             StrCmp${_WORDFUNC_S} $1 $8 0 nextword
  270.             StrCpy $R1 $4
  271.             goto end
  272.             nextword:
  273.             IntOp $6 $6 + $7
  274.             StrCpy $5 $6
  275.             goto loop
  276.  
  277.             minus:
  278.             StrCmp${_WORDFUNC_S} $2 '-' 0 sum
  279.             StrCpy $2 '+'
  280.             IntOp $1 $4 - $1
  281.             IntOp $1 $1 + 1
  282.             IntCmp $1 0 error2 error2 restart
  283.             sum:
  284.             StrCmp${_WORDFUNC_S} $2 '#' 0 sumdelim
  285.             StrCpy $R1 $4
  286.             goto end
  287.             sumdelim:
  288.             StrCmp${_WORDFUNC_S} $2 '*' 0 error2
  289.             StrCpy $R1 $4
  290.             goto end
  291.  
  292.             plus:
  293.             StrCmp${_WORDFUNC_S} $3 '' 0 +4
  294.             IntOp $6 $6 - $5
  295.             StrCpy $R1 $R0 $6 $5
  296.             goto end
  297.             StrCmp${_WORDFUNC_S} $3 '{' 0 +3
  298.             StrCpy $R1 $R0 $6
  299.             goto end
  300.             StrCmp${_WORDFUNC_S} $3 '}' 0 +4
  301.             IntOp $6 $6 + $7
  302.             StrCpy $R1 $R0 '' $6
  303.             goto end
  304.             StrCmp${_WORDFUNC_S} $3 '{*' +2
  305.             StrCmp${_WORDFUNC_S} $3 '*{' 0 +3
  306.             StrCpy $R1 $R0 $6
  307.             goto end
  308.             StrCmp${_WORDFUNC_S} $3 '*}' +2
  309.             StrCmp${_WORDFUNC_S} $3 '}*' 0 +3
  310.             StrCpy $R1 $R0 '' $5
  311.             goto end
  312.             StrCmp${_WORDFUNC_S} $3 '}}' 0 +3
  313.             StrCpy $R1 $R0 '' $6
  314.             goto end
  315.             StrCmp${_WORDFUNC_S} $3 '{{' 0 +3
  316.             StrCpy $R1 $R0 $5
  317.             goto end
  318.             StrCmp${_WORDFUNC_S} $3 '{}' 0 error3
  319.             StrLen $3 $R0
  320.             StrCmp${_WORDFUNC_S} $3 $6 0 +3
  321.             StrCpy $0 ''
  322.             goto +2
  323.             IntOp $6 $6 + $7
  324.             StrCpy $8 $R0 '' $6
  325.             StrCmp${_WORDFUNC_S} $4$8 1 +6
  326.             StrCmp${_WORDFUNC_S} $4 1 +2 +7
  327.             IntOp $6 $6 + $7
  328.             StrCpy $3 $R0 $7 $6
  329.             StrCmp${_WORDFUNC_S} $3 '' +2
  330.             StrCmp${_WORDFUNC_S} $3 $0 -3 +3
  331.             StrCpy $R1 ''
  332.             goto end
  333.             StrCmp${_WORDFUNC_S} $5 0 0 +3
  334.             StrCpy $0 ''
  335.             goto +2
  336.             IntOp $5 $5 - $7
  337.             StrCpy $3 $R0 $5
  338.             StrCpy $R1 '$3$0$8'
  339.             goto end
  340.  
  341.             error3:
  342.             StrCpy $R1 3
  343.             goto error
  344.             error2:
  345.             StrCpy $R1 2
  346.             goto error
  347.             error1:
  348.             StrCpy $R1 1
  349.             error:
  350.             StrCmp $9 'E' 0 +3
  351.             SetErrors
  352.  
  353.             end:
  354.             StrCpy $R0 $R1
  355.  
  356.             Pop $R1
  357.             Pop $9
  358.             Pop $8
  359.             Pop $7
  360.             Pop $6
  361.             Pop $5
  362.             Pop $4
  363.             Pop $3
  364.             Pop $2
  365.             Pop $1
  366.             Pop $0
  367.             Exch $R0
  368.         FunctionEnd
  369.  
  370.         !verbose pop
  371.     !endif
  372. !macroend
  373.  
  374. !macro WordFind2X
  375.     !ifndef ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
  376.         !verbose push
  377.         !verbose ${_WORDFUNC_VERBOSE}
  378.         !define ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}Call`
  379.  
  380.         Function ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
  381.             Exch $2
  382.             Exch
  383.             Exch $1
  384.             Exch
  385.             Exch 2
  386.             Exch $0
  387.             Exch 2
  388.             Exch 3
  389.             Exch $R0
  390.             Exch 3
  391.             Push $3
  392.             Push $4
  393.             Push $5
  394.             Push $6
  395.             Push $7
  396.             Push $8
  397.             Push $9
  398.             Push $R1
  399.             Push $R2
  400.             ClearErrors
  401.  
  402.             StrCpy $R2 ''
  403.             StrCpy $3 $2 1
  404.             StrCpy $2 $2 '' 1
  405.             StrCmp $3 'E' 0 +3
  406.             StrCpy $R2 E
  407.             goto -4
  408.  
  409.             StrCmp${_WORDFUNC_S} $3 '+' +5
  410.             StrCmp${_WORDFUNC_S} $3 '-' +4
  411.             StrCmp${_WORDFUNC_S} $3 '#' restart
  412.             StrCmp${_WORDFUNC_S} $3 '/' restart
  413.             goto error3
  414.  
  415.             StrCpy $4 $2 2 -2
  416.             StrCmp${_WORDFUNC_S} $4 '{{' +9
  417.             StrCmp${_WORDFUNC_S} $4 '}}' +8
  418.             StrCmp${_WORDFUNC_S} $4 '{*' +7
  419.             StrCmp${_WORDFUNC_S} $4 '*{' +6
  420.             StrCmp${_WORDFUNC_S} $4 '*}' +5
  421.             StrCmp${_WORDFUNC_S} $4 '}*' +4
  422.             StrCmp${_WORDFUNC_S} $4 '{}' +3
  423.             StrCpy $4 ''
  424.             goto +2
  425.             StrCpy $2 $2 -2
  426.             IntOp $2 $2 + 0
  427.             StrCmp${_WORDFUNC_S} $2 0 error2
  428.  
  429.             restart:
  430.             StrCmp${_WORDFUNC_S} $R0 '' error1
  431.             StrCpy $5 -1
  432.             StrCpy $6 0
  433.             StrCpy $7 ''
  434.             StrLen $8 $0
  435.             StrLen $9 $1
  436.  
  437.             loop:
  438.             IntOp $5 $5 + 1
  439.  
  440.             delim1:
  441.             StrCpy $R1 $R0 $8 $5
  442.             StrCmp${_WORDFUNC_S} $R1$6 0 error1
  443.             StrCmp${_WORDFUNC_S} $R1 '' minus
  444.             StrCmp${_WORDFUNC_S} $R1 $0 +2
  445.             StrCmp${_WORDFUNC_S} $7 '' loop delim2
  446.             StrCmp${_WORDFUNC_S} $0 $1 0 +2
  447.             StrCmp${_WORDFUNC_S} $7 '' 0 delim2
  448.             IntOp $7 $5 + $8
  449.             StrCpy $5 $7
  450.             goto delim1
  451.  
  452.             delim2:
  453.             StrCpy $R1 $R0 $9 $5
  454.             StrCmp${_WORDFUNC_S} $R1 $1 0 loop
  455.             IntOp $6 $6 + 1
  456.             StrCmp${_WORDFUNC_S} $3$6 '+$2' plus
  457.             StrCmp${_WORDFUNC_S} $3 '/' 0 nextword
  458.             IntOp $R1 $5 - $7
  459.             StrCpy $R1 $R0 $R1 $7
  460.             StrCmp${_WORDFUNC_S} $R1 $2 0 +3
  461.             StrCpy $R1 $6
  462.             goto end
  463.             nextword:
  464.             IntOp $5 $5 + $9
  465.             StrCpy $7 ''
  466.             goto delim1
  467.  
  468.             minus:
  469.             StrCmp${_WORDFUNC_S} $3 '-' 0 sum
  470.             StrCpy $3 +
  471.             IntOp $2 $6 - $2
  472.             IntOp $2 $2 + 1
  473.             IntCmp $2 0 error2 error2 restart
  474.             sum:
  475.             StrCmp${_WORDFUNC_S} $3 '#' 0 error2
  476.             StrCpy $R1 $6
  477.             goto end
  478.  
  479.             plus:
  480.             StrCmp${_WORDFUNC_S} $4 '' 0 +4
  481.             IntOp $R1 $5 - $7
  482.             StrCpy $R1 $R0 $R1 $7
  483.             goto end
  484.             IntOp $5 $5 + $9
  485.             IntOp $7 $7 - $8
  486.             StrCmp${_WORDFUNC_S} $4 '{*' +2
  487.             StrCmp${_WORDFUNC_S} $4 '*{' 0 +3
  488.             StrCpy $R1 $R0 $5
  489.             goto end
  490.             StrCmp${_WORDFUNC_S} $4 '*}' +2
  491.             StrCmp${_WORDFUNC_S} $4 '}*' 0 +3
  492.             StrCpy $R1 $R0 '' $7
  493.             goto end
  494.             StrCmp${_WORDFUNC_S} $4 '}}' 0 +3
  495.             StrCpy $R1 $R0 '' $5
  496.             goto end
  497.             StrCmp${_WORDFUNC_S} $4 '{{' 0 +3
  498.             StrCpy $R1 $R0 $7
  499.             goto end
  500.             StrCmp${_WORDFUNC_S} $4 '{}' 0 error3
  501.             StrCpy $5 $R0 '' $5
  502.             StrCpy $7 $R0 $7
  503.             StrCpy $R1 '$7$5'
  504.             goto end
  505.  
  506.             error3:
  507.             StrCpy $R1 3
  508.             goto error
  509.             error2:
  510.             StrCpy $R1 2
  511.             goto error
  512.             error1:
  513.             StrCpy $R1 1
  514.             error:
  515.             StrCmp $R2 'E' 0 +3
  516.             SetErrors
  517.  
  518.             end:
  519.             StrCpy $R0 $R1
  520.  
  521.             Pop $R2
  522.             Pop $R1
  523.             Pop $9
  524.             Pop $8
  525.             Pop $7
  526.             Pop $6
  527.             Pop $5
  528.             Pop $4
  529.             Pop $3
  530.             Pop $2
  531.             Pop $1
  532.             Pop $0
  533.             Exch $R0
  534.         FunctionEnd
  535.  
  536.         !verbose pop
  537.     !endif
  538. !macroend
  539.  
  540. !macro WordFind3X
  541.     !ifndef ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
  542.         !verbose push
  543.         !verbose ${_WORDFUNC_VERBOSE}
  544.         !define ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}Call`
  545.  
  546.         Function ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
  547.             Exch $3
  548.             Exch
  549.             Exch $2
  550.             Exch
  551.             Exch 2
  552.             Exch $1
  553.             Exch 2
  554.             Exch 3
  555.             Exch $0
  556.             Exch 3
  557.             Exch 4
  558.             Exch $R0
  559.             Exch 4
  560.             Push $4
  561.             Push $5
  562.             Push $6
  563.             Push $7
  564.             Push $8
  565.             Push $9
  566.             Push $R1
  567.             Push $R2
  568.             Push $R3
  569.             Push $R4
  570.             Push $R5
  571.             ClearErrors
  572.  
  573.             StrCpy $R5 ''
  574.             StrCpy $4 $3 1
  575.             StrCpy $3 $3 '' 1
  576.             StrCmp $4 'E' 0 +3
  577.             StrCpy $R5 E
  578.             goto -4
  579.  
  580.             StrCmp${_WORDFUNC_S} $4 '+' +5
  581.             StrCmp${_WORDFUNC_S} $4 '-' +4
  582.             StrCmp${_WORDFUNC_S} $4 '#' restart
  583.             StrCmp${_WORDFUNC_S} $4 '/' restart
  584.             goto error3
  585.  
  586.             StrCpy $5 $3 2 -2
  587.             StrCmp${_WORDFUNC_S} $5 '{{' +9
  588.             StrCmp${_WORDFUNC_S} $5 '}}' +8
  589.             StrCmp${_WORDFUNC_S} $5 '{*' +7
  590.             StrCmp${_WORDFUNC_S} $5 '*{' +6
  591.             StrCmp${_WORDFUNC_S} $5 '*}' +5
  592.             StrCmp${_WORDFUNC_S} $5 '}*' +4
  593.             StrCmp${_WORDFUNC_S} $5 '{}' +3
  594.             StrCpy $5 ''
  595.             goto +2
  596.             StrCpy $3 $3 -2
  597.             IntOp $3 $3 + 0
  598.             StrCmp${_WORDFUNC_S} $3 0 error2
  599.  
  600.             restart:
  601.             StrCmp${_WORDFUNC_S} $R0 '' error1
  602.             StrCpy $6 -1
  603.             StrCpy $7 0
  604.             StrCpy $8 ''
  605.             StrCpy $9 ''
  606.             StrLen $R1 $0
  607.             StrLen $R2 $1
  608.             StrLen $R3 $2
  609.  
  610.             loop:
  611.             IntOp $6 $6 + 1
  612.  
  613.             delim1:
  614.             StrCpy $R4 $R0 $R1 $6
  615.             StrCmp${_WORDFUNC_S} $R4$7 0 error1
  616.             StrCmp${_WORDFUNC_S} $R4 '' minus
  617.             StrCmp${_WORDFUNC_S} $R4 $0 +2
  618.             StrCmp${_WORDFUNC_S} $8 '' loop center
  619.             StrCmp${_WORDFUNC_S} $0 $1 +2
  620.             StrCmp${_WORDFUNC_S} $0 $2 0 +2
  621.             StrCmp${_WORDFUNC_S} $8 '' 0 center
  622.             IntOp $8 $6 + $R1
  623.             StrCpy $6 $8
  624.             goto delim1
  625.  
  626.             center:
  627.             StrCmp${_WORDFUNC_S} $9 '' 0 delim2
  628.             StrCpy $R4 $R0 $R2 $6
  629.             StrCmp${_WORDFUNC_S} $R4 $1 0 loop
  630.             IntOp $9 $6 + $R2
  631.             StrCpy $6 $9
  632.             goto delim1
  633.  
  634.             delim2:
  635.             StrCpy $R4 $R0 $R3 $6
  636.             StrCmp${_WORDFUNC_S} $R4 $2 0 loop
  637.             IntOp $7 $7 + 1
  638.             StrCmp${_WORDFUNC_S} $4$7 '+$3' plus
  639.             StrCmp${_WORDFUNC_S} $4 '/' 0 nextword
  640.             IntOp $R4 $6 - $8
  641.             StrCpy $R4 $R0 $R4 $8
  642.             StrCmp${_WORDFUNC_S} $R4 $3 0 +3
  643.             StrCpy $R4 $7
  644.             goto end
  645.             nextword:
  646.             IntOp $6 $6 + $R3
  647.             StrCpy $8 ''
  648.             StrCpy $9 ''
  649.             goto delim1
  650.  
  651.             minus:
  652.             StrCmp${_WORDFUNC_S} $4 '-' 0 sum
  653.             StrCpy $4 +
  654.             IntOp $3 $7 - $3
  655.             IntOp $3 $3 + 1
  656.             IntCmp $3 0 error2 error2 restart
  657.             sum:
  658.             StrCmp${_WORDFUNC_S} $4 '#' 0 error2
  659.             StrCpy $R4 $7
  660.             goto end
  661.  
  662.             plus:
  663.             StrCmp${_WORDFUNC_S} $5 '' 0 +4
  664.             IntOp $R4 $6 - $8
  665.             StrCpy $R4 $R0 $R4 $8
  666.             goto end
  667.             IntOp $6 $6 + $R3
  668.             IntOp $8 $8 - $R1
  669.             StrCmp${_WORDFUNC_S} $5 '{*' +2
  670.             StrCmp${_WORDFUNC_S} $5 '*{' 0 +3
  671.             StrCpy $R4 $R0 $6
  672.             goto end
  673.             StrCmp${_WORDFUNC_S} $5 '*}' +2
  674.             StrCmp${_WORDFUNC_S} $5 '}*' 0 +3
  675.             StrCpy $R4 $R0 '' $8
  676.             goto end
  677.             StrCmp${_WORDFUNC_S} $5 '}}' 0 +3
  678.             StrCpy $R4 $R0 '' $6
  679.             goto end
  680.             StrCmp${_WORDFUNC_S} $5 '{{' 0 +3
  681.             StrCpy $R4 $R0 $8
  682.             goto end
  683.             StrCmp${_WORDFUNC_S} $5 '{}' 0 error3
  684.             StrCpy $6 $R0 '' $6
  685.             StrCpy $8 $R0 $8
  686.             StrCpy $R4 '$8$6'
  687.             goto end
  688.  
  689.             error3:
  690.             StrCpy $R4 3
  691.             goto error
  692.             error2:
  693.             StrCpy $R4 2
  694.             goto error
  695.             error1:
  696.             StrCpy $R4 1
  697.             error:
  698.             StrCmp $R5 'E' 0 +3
  699.             SetErrors
  700.  
  701.             end:
  702.             StrCpy $R0 $R4
  703.             Pop $R5
  704.             Pop $R4
  705.             Pop $R3
  706.             Pop $R2
  707.             Pop $R1
  708.             Pop $9
  709.             Pop $8
  710.             Pop $7
  711.             Pop $6
  712.             Pop $5
  713.             Pop $4
  714.             Pop $3
  715.             Pop $2
  716.             Pop $1
  717.             Pop $0
  718.             Exch $R0
  719.         FunctionEnd
  720.  
  721.         !verbose pop
  722.     !endif
  723. !macroend
  724.  
  725. !macro WordReplace
  726.     !ifndef ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
  727.         !verbose push
  728.         !verbose ${_WORDFUNC_VERBOSE}
  729.         !define ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}Call`
  730.  
  731.         Function ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
  732.             Exch $2
  733.             Exch
  734.             Exch $1
  735.             Exch
  736.             Exch 2
  737.             Exch $0
  738.             Exch 2
  739.             Exch 3
  740.             Exch $R0
  741.             Exch 3
  742.             Push $3
  743.             Push $4
  744.             Push $5
  745.             Push $6
  746.             Push $7
  747.             Push $8
  748.             Push $9
  749.             Push $R1
  750.             ClearErrors
  751.  
  752.             StrCpy $R1 $R0
  753.             StrCpy $9 ''
  754.             StrCpy $3 $2 1
  755.             StrCpy $2 $2 '' 1
  756.             StrCmp $3 'E' 0 +3
  757.             StrCpy $9 E
  758.             goto -4
  759.  
  760.             StrCpy $4 $2 1 -1
  761.             StrCpy $5 ''
  762.             StrCpy $6 ''
  763.             StrLen $7 $0
  764.  
  765.             StrCmp${_WORDFUNC_S} $7 0 error1
  766.             StrCmp${_WORDFUNC_S} $R0 '' error1
  767.             StrCmp${_WORDFUNC_S} $3 '{' beginning
  768.             StrCmp${_WORDFUNC_S} $3 '}' ending errorchk
  769.  
  770.             beginning:
  771.             StrCpy $8 $R0 $7
  772.             StrCmp${_WORDFUNC_S} $8 $0 0 +4
  773.             StrCpy $R0 $R0 '' $7
  774.             StrCpy $5 '$5$1'
  775.             goto -4
  776.             StrCpy $3 $2 1
  777.             StrCmp${_WORDFUNC_S} $3 '}' 0 merge
  778.  
  779.             ending:
  780.             StrCpy $8 $R0 '' -$7
  781.             StrCmp${_WORDFUNC_S} $8 $0 0 +4
  782.             StrCpy $R0 $R0 -$7
  783.             StrCpy $6 '$6$1'
  784.             goto -4
  785.  
  786.             merge:
  787.             StrCmp${_WORDFUNC_S} $4 '*' 0 +5
  788.             StrCmp${_WORDFUNC_S} $5 '' +2
  789.             StrCpy $5 $1
  790.             StrCmp${_WORDFUNC_S} $6 '' +2
  791.             StrCpy $6 $1
  792.             StrCpy $R0 '$5$R0$6'
  793.             goto end
  794.  
  795.             errorchk:
  796.             StrCmp${_WORDFUNC_S} $3 '+' +2
  797.             StrCmp${_WORDFUNC_S} $3 '-' 0 error3
  798.  
  799.             StrCpy $5 $2 1
  800.             IntOp $2 $2 + 0
  801.             StrCmp${_WORDFUNC_S} $2 0 0 one
  802.             StrCmp${_WORDFUNC_S} $5 0 error2
  803.             StrCpy $3 ''
  804.  
  805.             all:
  806.             StrCpy $5 0
  807.             StrCpy $2 $R0 $7 $5
  808.             StrCmp${_WORDFUNC_S} $2 '' +4
  809.             StrCmp${_WORDFUNC_S} $2 $0 +6
  810.             IntOp $5 $5 + 1
  811.             goto -4
  812.             StrCmp${_WORDFUNC_S} $R0 $R1 error1
  813.             StrCpy $R0 '$3$R0'
  814.             goto end
  815.             StrCpy $2 $R0 $5
  816.             IntOp $5 $5 + $7
  817.             StrCmp${_WORDFUNC_S} $4 '*' 0 +3
  818.             StrCpy $6 $R0 $7 $5
  819.             StrCmp${_WORDFUNC_S} $6 $0 -3
  820.             StrCpy $R0 $R0 '' $5
  821.             StrCpy $3 '$3$2$1'
  822.             goto all
  823.  
  824.             one:
  825.             StrCpy $5 0
  826.             StrCpy $8 0
  827.             goto loop
  828.  
  829.             preloop:
  830.             IntOp $5 $5 + 1
  831.  
  832.             loop:
  833.             StrCpy $6 $R0 $7 $5
  834.             StrCmp${_WORDFUNC_S} $6$8 0 error1
  835.             StrCmp${_WORDFUNC_S} $6 '' minus
  836.             StrCmp${_WORDFUNC_S} $6 $0 0 preloop
  837.             IntOp $8 $8 + 1
  838.             StrCmp${_WORDFUNC_S} $3$8 +$2 found
  839.             IntOp $5 $5 + $7
  840.             goto loop
  841.  
  842.             minus:
  843.             StrCmp${_WORDFUNC_S} $3 '-' 0 error2
  844.             StrCpy $3 +
  845.             IntOp $2 $8 - $2
  846.             IntOp $2 $2 + 1
  847.             IntCmp $2 0 error2 error2 one
  848.  
  849.             found:
  850.             StrCpy $3 $R0 $5
  851.             StrCmp${_WORDFUNC_S} $4 '*' 0 +5
  852.             StrCpy $6 $3 '' -$7
  853.             StrCmp${_WORDFUNC_S} $6 $0 0 +3
  854.             StrCpy $3 $3 -$7
  855.             goto -3
  856.             IntOp $5 $5 + $7
  857.             StrCmp${_WORDFUNC_S} $4 '*' 0 +3
  858.             StrCpy $6 $R0 $7 $5
  859.             StrCmp${_WORDFUNC_S} $6 $0 -3
  860.             StrCpy $R0 $R0 '' $5
  861.             StrCpy $R0 '$3$1$R0'
  862.             goto end
  863.  
  864.             error3:
  865.             StrCpy $R0 3
  866.             goto error
  867.             error2:
  868.             StrCpy $R0 2
  869.             goto error
  870.             error1:
  871.             StrCpy $R0 1
  872.             error:
  873.             StrCmp $9 'E' +3
  874.             StrCpy $R0 $R1
  875.             goto +2
  876.             SetErrors
  877.  
  878.             end:
  879.             Pop $R1
  880.             Pop $9
  881.             Pop $8
  882.             Pop $7
  883.             Pop $6
  884.             Pop $5
  885.             Pop $4
  886.             Pop $3
  887.             Pop $2
  888.             Pop $1
  889.             Pop $0
  890.             Exch $R0
  891.         FunctionEnd
  892.  
  893.         !verbose pop
  894.     !endif
  895. !macroend
  896.  
  897. !macro WordAdd
  898.     !ifndef ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
  899.         !verbose push
  900.         !verbose ${_WORDFUNC_VERBOSE}
  901.         !insertmacro WordFind
  902.  
  903.         !define ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}Call`
  904.  
  905.         Function ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
  906.             Exch $1
  907.             Exch
  908.             Exch $0
  909.             Exch
  910.             Exch 2
  911.             Exch $R0
  912.             Exch 2
  913.             Push $2
  914.             Push $3
  915.             Push $4
  916.             Push $5
  917.             Push $6
  918.             Push $7
  919.             Push $R1
  920.             ClearErrors
  921.  
  922.             StrCpy $7 ''
  923.             StrCpy $2 $1 1
  924.             StrCmp $2 'E' 0 +4
  925.             StrCpy $7 E
  926.             StrCpy $1 $1 '' 1
  927.             goto -4
  928.  
  929.             StrCpy $5 0
  930.             StrCpy $R1 $R0
  931.             StrCpy $2 $1 '' 1
  932.             StrCpy $1 $1 1
  933.             StrCmp${_WORDFUNC_S} $1 '+' +2
  934.             StrCmp${_WORDFUNC_S} $1 '-' 0 error3
  935.  
  936.             StrCmp${_WORDFUNC_S} $0 '' error1
  937.             StrCmp${_WORDFUNC_S} $2 '' end
  938.             StrCmp${_WORDFUNC_S} $R0 '' 0 +5
  939.             StrCmp${_WORDFUNC_S} $1 '-' end
  940.             StrCmp${_WORDFUNC_S} $1 '+' 0 +3
  941.             StrCpy $R0 $2
  942.             goto end
  943.  
  944.             loop:
  945.             IntOp $5 $5 + 1
  946.             Push `$2`
  947.             Push `$0`
  948.             Push `E+$5`
  949.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  950.             Pop $3
  951.             IfErrors 0 /word
  952.             StrCmp${_WORDFUNC_S} $3 2 +4
  953.             StrCmp${_WORDFUNC_S} $3$5 11 0 +3
  954.             StrCpy $3 $2
  955.             goto /word
  956.             StrCmp${_WORDFUNC_S} $1 '-' end preend
  957.  
  958.             /word:
  959.             Push `$R0`
  960.             Push `$0`
  961.             Push `E/$3`
  962.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  963.             Pop $4
  964.             IfErrors +2
  965.             StrCmp${_WORDFUNC_S} $1 '-' delete loop
  966.             StrCmp${_WORDFUNC_S} $1$4 '-1' +2
  967.             StrCmp${_WORDFUNC_S} $1 '-' loop +4
  968.             StrCmp${_WORDFUNC_S} $R0 $3 0 loop
  969.             StrCpy $R0 ''
  970.             goto end
  971.             StrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2
  972.             StrCmp${_WORDFUNC_S} $R0 $3 loop
  973.             StrCmp${_WORDFUNC_S} $R0 $R1 +3
  974.             StrCpy $R1 '$R1$0$3'
  975.             goto loop
  976.             StrLen $6 $0
  977.             StrCpy $6 $R0 '' -$6
  978.             StrCmp${_WORDFUNC_S} $6 $0 0 -4
  979.             StrCpy $R1 '$R1$3'
  980.             goto loop
  981.  
  982.             delete:
  983.             Push `$R0`
  984.             Push `$0`
  985.             Push `E+$4{}`
  986.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  987.             Pop $R0
  988.             goto /word
  989.  
  990.             error3:
  991.             StrCpy $R1 3
  992.             goto error
  993.             error1:
  994.             StrCpy $R1 1
  995.             error:
  996.             StrCmp $7 'E' 0 end
  997.             SetErrors
  998.  
  999.             preend:
  1000.             StrCpy $R0 $R1
  1001.  
  1002.             end:
  1003.             Pop $R1
  1004.             Pop $7
  1005.             Pop $6
  1006.             Pop $5
  1007.             Pop $4
  1008.             Pop $3
  1009.             Pop $2
  1010.             Pop $1
  1011.             Pop $0
  1012.             Exch $R0
  1013.         FunctionEnd
  1014.  
  1015.         !verbose pop
  1016.     !endif
  1017. !macroend
  1018.  
  1019. !macro WordInsert
  1020.     !ifndef ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
  1021.         !verbose push
  1022.         !verbose ${_WORDFUNC_VERBOSE}
  1023.         !insertmacro WordFind
  1024.  
  1025.         !define ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}Call`
  1026.  
  1027.         Function ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
  1028.             Exch $2
  1029.             Exch
  1030.             Exch $1
  1031.             Exch
  1032.             Exch 2
  1033.             Exch $0
  1034.             Exch 2
  1035.             Exch 3
  1036.             Exch $R0
  1037.             Exch 3
  1038.             Push $3
  1039.             Push $4
  1040.             Push $5
  1041.             Push $6
  1042.             Push $7
  1043.             Push $8
  1044.             Push $9
  1045.             Push $R1
  1046.             ClearErrors
  1047.  
  1048.             StrCpy $5 ''
  1049.             StrCpy $6 $0
  1050.             StrCpy $7 }
  1051.  
  1052.             StrCpy $9 ''
  1053.             StrCpy $R1 $R0
  1054.             StrCpy $3 $2 1
  1055.             StrCpy $2 $2 '' 1
  1056.             StrCmp $3 'E' 0 +3
  1057.             StrCpy $9 'E'
  1058.             goto -4
  1059.  
  1060.             StrCmp${_WORDFUNC_S} $3 '+' +2
  1061.             StrCmp${_WORDFUNC_S} $3 '-' 0 error3
  1062.             IntOp $2 $2 + 0
  1063.             StrCmp${_WORDFUNC_S} $2 0 error2
  1064.             StrCmp${_WORDFUNC_S} $0 '' error1
  1065.  
  1066.             StrCmp${_WORDFUNC_S} $2 1 0 two
  1067.             GetLabelAddress $8 oneback
  1068.             StrCmp${_WORDFUNC_S} $3 '+' call
  1069.             StrCpy $7 {
  1070.             goto call
  1071.             oneback:
  1072.             IfErrors 0 +2
  1073.             StrCpy $4 $R0
  1074.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1075.             StrCpy $R0 '$1$0$4'
  1076.             goto end
  1077.             StrCpy $R0 '$4$0$1'
  1078.             goto end
  1079.  
  1080.             two:
  1081.             IntOp $2 $2 - 1
  1082.             GetLabelAddress $8 twoback
  1083.             StrCmp${_WORDFUNC_S} $3 '+' 0 call
  1084.             StrCpy $7 {
  1085.             goto call
  1086.             twoback:
  1087.             IfErrors 0 tree
  1088.             StrCmp${_WORDFUNC_S} $2$4 11 0 error2
  1089.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1090.             StrCpy $R0 '$R0$0$1'
  1091.             goto end
  1092.             StrCpy $R0 '$1$0$R0'
  1093.             goto end
  1094.  
  1095.             tree:
  1096.             StrCpy $7 }
  1097.             StrCpy $5 $4
  1098.             IntOp $2 $2 + 1
  1099.             GetLabelAddress $8 treeback
  1100.             StrCmp${_WORDFUNC_S} $3 '+' call
  1101.             StrCpy $7 {
  1102.             goto call
  1103.             treeback:
  1104.             IfErrors 0 +3
  1105.             StrCpy $4 ''
  1106.             StrCpy $6 ''
  1107.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1108.             StrCpy $R0 '$5$0$1$6$4'
  1109.             goto end
  1110.             StrCpy $R0 '$4$6$1$0$5'
  1111.             goto end
  1112.  
  1113.             call:            
  1114.             Push '$R0'
  1115.             Push '$0'
  1116.             Push 'E$3$2*$7'
  1117.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  1118.             Pop $4
  1119.             goto $8
  1120.  
  1121.             error3:
  1122.             StrCpy $R0 3
  1123.             goto error
  1124.             error2:
  1125.             StrCpy $R0 2
  1126.             goto error
  1127.             error1:
  1128.             StrCpy $R0 1
  1129.             error:
  1130.             StrCmp $9 'E' +3
  1131.             StrCpy $R0 $R1
  1132.             goto +2
  1133.             SetErrors
  1134.  
  1135.             end:
  1136.             Pop $R1
  1137.             Pop $9
  1138.             Pop $8
  1139.             Pop $7
  1140.             Pop $6
  1141.             Pop $5
  1142.             Pop $4
  1143.             Pop $3
  1144.             Pop $2
  1145.             Pop $1
  1146.             Pop $0
  1147.             Exch $R0
  1148.         FunctionEnd
  1149.  
  1150.         !verbose pop
  1151.     !endif
  1152. !macroend
  1153.  
  1154. !macro StrFilter
  1155.     !ifndef ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
  1156.         !verbose push
  1157.         !verbose ${_WORDFUNC_VERBOSE}
  1158.         !define ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}Call`
  1159.  
  1160.         Function ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
  1161.             Exch $2
  1162.             Exch
  1163.             Exch $1
  1164.             Exch
  1165.             Exch 2
  1166.             Exch $0
  1167.             Exch 2
  1168.             Exch 3
  1169.             Exch $R0
  1170.             Exch 3
  1171.             Push $3
  1172.             Push $4
  1173.             Push $5
  1174.             Push $6
  1175.             Push $7
  1176.             Push $R1
  1177.             Push $R2
  1178.             Push $R3
  1179.             Push $R4
  1180.             Push $R5
  1181.             Push $R6
  1182.             Push $R7
  1183.             Push $R8
  1184.             ClearErrors
  1185.  
  1186.             StrCpy $R2 $0 '' -3
  1187.             StrCmp $R2 eng eng
  1188.             StrCmp $R2 rus rus
  1189.             eng:
  1190.             StrCpy $4 65
  1191.             StrCpy $5 90
  1192.             StrCpy $6 97
  1193.             StrCpy $7 122
  1194.             goto langend
  1195.             rus:
  1196.             StrCpy $4 192
  1197.             StrCpy $5 223
  1198.             StrCpy $6 224
  1199.             StrCpy $7 255
  1200.             goto langend
  1201.             ;...
  1202.  
  1203.             langend:
  1204.             StrCpy $R7 ''
  1205.             StrCpy $R8 ''
  1206.  
  1207.             StrCmp${_WORDFUNC_S} $2 '' 0 begin
  1208.  
  1209.             restart1:
  1210.             StrCpy $2 ''
  1211.             StrCpy $3 $0 1
  1212.             StrCmp${_WORDFUNC_S} $3 '+' +2
  1213.             StrCmp${_WORDFUNC_S} $3 '-' 0 +3
  1214.             StrCpy $0 $0 '' 1
  1215.             goto +2
  1216.             StrCpy $3 ''
  1217.  
  1218.             IntOp $0 $0 + 0
  1219.             StrCmp${_WORDFUNC_S} $0 0 +5
  1220.             StrCpy $R7 $0 1 0
  1221.             StrCpy $R8 $0 1 1
  1222.             StrCpy $R2 $0 1 2
  1223.             StrCmp${_WORDFUNC_S} $R2 '' filter error
  1224.  
  1225.             restart2:
  1226.             StrCmp${_WORDFUNC_S} $3 '' end
  1227.             StrCpy $R7 ''
  1228.             StrCpy $R8 '+-'
  1229.             goto begin
  1230.  
  1231.             filter:
  1232.             StrCmp${_WORDFUNC_S} $R7 '1' +3
  1233.             StrCmp${_WORDFUNC_S} $R7 '2' +2
  1234.             StrCmp${_WORDFUNC_S} $R7 '3' 0 error
  1235.  
  1236.             StrCmp${_WORDFUNC_S} $R8 '' begin
  1237.             StrCmp${_WORDFUNC_S} $R7$R8 '23' +2
  1238.             StrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3
  1239.             StrCpy $R7 -1
  1240.             goto begin
  1241.             StrCmp${_WORDFUNC_S} $R7$R8 '13' +2
  1242.             StrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3
  1243.             StrCpy $R7 -2
  1244.             goto begin
  1245.             StrCmp${_WORDFUNC_S} $R7$R8 '12' +2
  1246.             StrCmp${_WORDFUNC_S} $R7$R8 '21' 0 error
  1247.             StrCpy $R7 -3
  1248.  
  1249.             begin:
  1250.             StrCpy $R6 0
  1251.             StrCpy $R1 ''
  1252.  
  1253.             loop:
  1254.             StrCpy $R2 $R0 1 $R6
  1255.             StrCmp${_WORDFUNC_S} $R2 '' restartchk
  1256.  
  1257.             StrCmp${_WORDFUNC_S} $2 '' +7
  1258.             StrCpy $R4 0
  1259.             StrCpy $R5 $2 1 $R4
  1260.             StrCmp${_WORDFUNC_S} $R5 '' addsymbol
  1261.             StrCmp${_WORDFUNC_S} $R5 $R2 skipsymbol
  1262.             IntOp $R4 $R4 + 1
  1263.             goto -4
  1264.  
  1265.             StrCmp${_WORDFUNC_S} $1 '' +7
  1266.             StrCpy $R4 0
  1267.             StrCpy $R5 $1 1 $R4
  1268.             StrCmp${_WORDFUNC_S} $R5 '' +4
  1269.             StrCmp${_WORDFUNC_S} $R5 $R2 addsymbol
  1270.             IntOp $R4 $R4 + 1
  1271.             goto -4
  1272.  
  1273.             StrCmp${_WORDFUNC_S} $R7 '1' +2
  1274.             StrCmp${_WORDFUNC_S} $R7 '-1' 0 +4
  1275.             StrCpy $R4 48
  1276.             StrCpy $R5 57
  1277.             goto loop2
  1278.             StrCmp${_WORDFUNC_S} $R8 '+-' 0 +2
  1279.             StrCmp${_WORDFUNC_S} $3 '+' 0 +4
  1280.             StrCpy $R4 $4
  1281.             StrCpy $R5 $5
  1282.             goto loop2
  1283.             StrCpy $R4 $6
  1284.             StrCpy $R5 $7
  1285.  
  1286.             loop2:
  1287.             IntFmt $R3 '%c' $R4
  1288.             StrCmp $R2 $R3 found
  1289.             StrCmp $R4 $R5 notfound
  1290.             IntOp $R4 $R4 + 1
  1291.             goto loop2
  1292.  
  1293.             found:
  1294.             StrCmp${_WORDFUNC_S} $R8 '+-' setcase
  1295.             StrCmp${_WORDFUNC_S} $R7 '3' skipsymbol
  1296.             StrCmp${_WORDFUNC_S} $R7 '-3' addsymbol
  1297.             StrCmp${_WORDFUNC_S} $R8 '' addsymbol skipsymbol
  1298.  
  1299.             notfound:
  1300.             StrCmp${_WORDFUNC_S} $R8 '+-' addsymbol
  1301.             StrCmp${_WORDFUNC_S} $R7 '3' 0 +2
  1302.             StrCmp${_WORDFUNC_S} $R5 57 addsymbol +3
  1303.             StrCmp${_WORDFUNC_S} $R7 '-3' 0 +5
  1304.             StrCmp${_WORDFUNC_S} $R5 57 skipsymbol
  1305.             StrCpy $R4 48
  1306.             StrCpy $R5 57
  1307.             goto loop2
  1308.             StrCmp${_WORDFUNC_S} $R8 '' skipsymbol addsymbol
  1309.  
  1310.             setcase:
  1311.             StrCpy $R2 $R3
  1312.             addsymbol:
  1313.             StrCpy $R1 $R1$R2
  1314.             skipsymbol:
  1315.             IntOp $R6 $R6 + 1
  1316.             goto loop
  1317.  
  1318.             error:
  1319.             SetErrors
  1320.             StrCpy $R0 ''
  1321.             goto end
  1322.  
  1323.             restartchk:
  1324.             StrCpy $R0 $R1
  1325.             StrCmp${_WORDFUNC_S} $2 '' 0 restart1
  1326.             StrCmp${_WORDFUNC_S} $R8 '+-' 0 restart2
  1327.  
  1328.             end:
  1329.             Pop $R8
  1330.             Pop $R7
  1331.             Pop $R6
  1332.             Pop $R5
  1333.             Pop $R4
  1334.             Pop $R3
  1335.             Pop $R2
  1336.             Pop $R1
  1337.             Pop $7
  1338.             Pop $6
  1339.             Pop $5
  1340.             Pop $4
  1341.             Pop $3
  1342.             Pop $2
  1343.             Pop $1
  1344.             Pop $0
  1345.             Exch $R0
  1346.         FunctionEnd
  1347.  
  1348.         !verbose pop
  1349.     !endif
  1350. !macroend
  1351.  
  1352. !macro VersionCompare
  1353.     !ifndef ${_WORDFUNC_UN}VersionCompare
  1354.         !verbose push
  1355.         !verbose ${_WORDFUNC_VERBOSE}
  1356.         !define ${_WORDFUNC_UN}VersionCompare `!insertmacro ${_WORDFUNC_UN}VersionCompareCall`
  1357.  
  1358.         Function ${_WORDFUNC_UN}VersionCompare
  1359.             Exch $1
  1360.             Exch
  1361.             Exch $0
  1362.             Exch
  1363.             Push $2
  1364.             Push $3
  1365.             Push $4
  1366.             Push $5
  1367.             Push $6
  1368.             Push $7
  1369.  
  1370.             begin:
  1371.             StrCpy $2 -1
  1372.             IntOp $2 $2 + 1
  1373.             StrCpy $3 $0 1 $2
  1374.             StrCmp $3 '' +2
  1375.             StrCmp $3 '.' 0 -3
  1376.             StrCpy $4 $0 $2
  1377.             IntOp $2 $2 + 1
  1378.             StrCpy $0 $0 '' $2
  1379.  
  1380.             StrCpy $2 -1
  1381.             IntOp $2 $2 + 1
  1382.             StrCpy $3 $1 1 $2
  1383.             StrCmp $3 '' +2
  1384.             StrCmp $3 '.' 0 -3
  1385.             StrCpy $5 $1 $2
  1386.             IntOp $2 $2 + 1
  1387.             StrCpy $1 $1 '' $2
  1388.  
  1389.             StrCmp $4$5 '' equal
  1390.  
  1391.             StrCpy $6 -1
  1392.             IntOp $6 $6 + 1
  1393.             StrCpy $3 $4 1 $6
  1394.             StrCmp $3 '0' -2
  1395.             StrCmp $3 '' 0 +2
  1396.             StrCpy $4 0
  1397.  
  1398.             StrCpy $7 -1
  1399.             IntOp $7 $7 + 1
  1400.             StrCpy $3 $5 1 $7
  1401.             StrCmp $3 '0' -2
  1402.             StrCmp $3 '' 0 +2
  1403.             StrCpy $5 0
  1404.  
  1405.             StrCmp $4 0 0 +2
  1406.             StrCmp $5 0 begin newer2
  1407.             StrCmp $5 0 newer1
  1408.             IntCmp $6 $7 0 newer1 newer2
  1409.  
  1410.             StrCpy $4 '1$4'
  1411.             StrCpy $5 '1$5'
  1412.             IntCmp $4 $5 begin newer2 newer1
  1413.  
  1414.             equal:
  1415.             StrCpy $0 0
  1416.             goto end
  1417.             newer1:
  1418.             StrCpy $0 1
  1419.             goto end
  1420.             newer2:
  1421.             StrCpy $0 2
  1422.  
  1423.             end:
  1424.             Pop $7
  1425.             Pop $6
  1426.             Pop $5
  1427.             Pop $4
  1428.             Pop $3
  1429.             Pop $2
  1430.             Pop $1
  1431.             Exch $0
  1432.         FunctionEnd
  1433.  
  1434.         !verbose pop
  1435.     !endif
  1436. !macroend
  1437.  
  1438. !macro VersionConvert
  1439.     !ifndef ${_WORDFUNC_UN}VersionConvert
  1440.         !verbose push
  1441.         !verbose ${_WORDFUNC_VERBOSE}
  1442.         !define ${_WORDFUNC_UN}VersionConvert `!insertmacro ${_WORDFUNC_UN}VersionConvertCall`
  1443.  
  1444.         Function ${_WORDFUNC_UN}VersionConvert
  1445.             Exch $1
  1446.             Exch
  1447.             Exch $0
  1448.             Exch
  1449.             Push $2
  1450.             Push $3
  1451.             Push $4
  1452.             Push $5
  1453.             Push $6
  1454.             Push $7
  1455.  
  1456.             StrCmp $1 '' 0 +2
  1457.             StrCpy $1 'abcdefghijklmnopqrstuvwxyz'
  1458.             StrCpy $1 $1 99
  1459.  
  1460.             StrCpy $2 0
  1461.             StrCpy $7 'dot'
  1462.             goto loop
  1463.  
  1464.             preloop:
  1465.             IntOp $2 $2 + 1
  1466.  
  1467.             loop:
  1468.             StrCpy $3 $0 1 $2
  1469.             StrCmp $3 '' endcheck
  1470.             StrCmp $3 '.' dot
  1471.             StrCmp $3 '0' digit
  1472.             IntCmp $3 '0' letter letter digit
  1473.  
  1474.             dot:
  1475.             StrCmp $7 'dot' replacespecial
  1476.             StrCpy $7 'dot'
  1477.             goto preloop
  1478.  
  1479.             digit:
  1480.             StrCmp $7 'letter' insertdot
  1481.             StrCpy $7 'digit'
  1482.             goto preloop
  1483.  
  1484.             letter:
  1485.             StrCpy $5 0
  1486.             StrCpy $4 $1 1 $5
  1487.             IntOp $5 $5 + 1
  1488.             StrCmp $4 '' replacespecial
  1489.             StrCmp $4 $3 0 -3
  1490.             IntCmp $5 9 0 0 +2
  1491.             StrCpy $5 '0$5'
  1492.  
  1493.             StrCmp $7 'letter' +2
  1494.             StrCmp $7 'dot' 0 +3
  1495.             StrCpy $6 ''
  1496.             goto +2
  1497.             StrCpy $6 '.'
  1498.  
  1499.             StrCpy $4 $0 $2
  1500.             IntOp $2 $2 + 1
  1501.             StrCpy $0 $0 '' $2
  1502.             StrCpy $0 '$4$6$5$0'
  1503.             StrLen $4 '$6$5'
  1504.             IntOp $2 $2 + $4
  1505.             IntOp $2 $2 - 1
  1506.             StrCpy $7 'letter'
  1507.             goto loop
  1508.  
  1509.             replacespecial:
  1510.             StrCmp $7 'dot' 0 +3
  1511.             StrCpy $6 ''
  1512.             goto +2
  1513.             StrCpy $6 '.'
  1514.  
  1515.             StrCpy $4 $0 $2
  1516.             IntOp $2 $2 + 1
  1517.             StrCpy $0 $0 '' $2
  1518.             StrCpy $0 '$4$6$0'
  1519.             StrLen $4 $6
  1520.             IntOp $2 $2 + $4
  1521.             IntOp $2 $2 - 1
  1522.             StrCpy $7 'dot'
  1523.             goto loop
  1524.  
  1525.             insertdot:
  1526.             StrCpy $4 $0 $2
  1527.             StrCpy $0 $0 '' $2
  1528.             StrCpy $0 '$4.$0'
  1529.             StrCpy $7 'dot'
  1530.             goto preloop
  1531.  
  1532.             endcheck:
  1533.             StrCpy $4 $0 1 -1
  1534.             StrCmp $4 '.' 0 end
  1535.             StrCpy $0 $0 -1
  1536.             goto -3
  1537.  
  1538.             end:
  1539.             Pop $7
  1540.             Pop $6
  1541.             Pop $5
  1542.             Pop $4
  1543.             Pop $3
  1544.             Pop $2
  1545.             Pop $1
  1546.             Exch $0
  1547.         FunctionEnd
  1548.  
  1549.         !verbose pop
  1550.     !endif
  1551. !macroend
  1552.  
  1553.  
  1554. # Uninstall. Case insensitive. #
  1555.  
  1556. !macro un.WordFindCall _STRING _DELIMITER _OPTION _RESULT
  1557.     !verbose push
  1558.     !verbose ${_WORDFUNC_VERBOSE}
  1559.     Push `${_STRING}`
  1560.     Push `${_DELIMITER}`
  1561.     Push `${_OPTION}`
  1562.     Call un.WordFind
  1563.     Pop ${_RESULT}
  1564.     !verbose pop
  1565. !macroend
  1566.  
  1567. !macro un.WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  1568.     !verbose push
  1569.     !verbose ${_WORDFUNC_VERBOSE}
  1570.     Push `${_STRING}`
  1571.     Push `${_DELIMITER1}`
  1572.     Push `${_DELIMITER2}`
  1573.     Push `${_NUMBER}`
  1574.     Call un.WordFind2X
  1575.     Pop ${_RESULT}
  1576.     !verbose pop
  1577. !macroend
  1578.  
  1579. !macro un.WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  1580.     !verbose push
  1581.     !verbose ${_WORDFUNC_VERBOSE}
  1582.     Push `${_STRING}`
  1583.     Push `${_DELIMITER1}`
  1584.     Push `${_CENTER}`
  1585.     Push `${_DELIMITER2}`
  1586.     Push `${_NUMBER}`
  1587.     Call un.WordFind3X
  1588.     Pop ${_RESULT}
  1589.     !verbose pop
  1590. !macroend
  1591.  
  1592. !macro un.WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  1593.     !verbose push
  1594.     !verbose ${_WORDFUNC_VERBOSE}
  1595.     Push `${_STRING}`
  1596.     Push `${_WORD1}`
  1597.     Push `${_WORD2}`
  1598.     Push `${_NUMBER}`
  1599.     Call un.WordReplace
  1600.     Pop ${_RESULT}
  1601.     !verbose pop
  1602. !macroend
  1603.  
  1604. !macro un.WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
  1605.     !verbose push
  1606.     !verbose ${_WORDFUNC_VERBOSE}
  1607.     Push `${_STRING1}`
  1608.     Push `${_DELIMITER}`
  1609.     Push `${_STRING2}`
  1610.     Call un.WordAdd
  1611.     Pop ${_RESULT}
  1612.     !verbose pop
  1613. !macroend
  1614.  
  1615. !macro un.WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  1616.     !verbose push
  1617.     !verbose ${_WORDFUNC_VERBOSE}
  1618.     Push `${_STRING}`
  1619.     Push `${_DELIMITER}`
  1620.     Push `${_WORD}`
  1621.     Push `${_NUMBER}`
  1622.     Call un.WordInsert
  1623.     Pop ${_RESULT}
  1624.     !verbose pop
  1625. !macroend
  1626.  
  1627. !macro un.StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  1628.     !verbose push
  1629.     !verbose ${_WORDFUNC_VERBOSE}
  1630.     Push `${_STRING}`
  1631.     Push `${_FILTER}`
  1632.     Push `${_INCLUDE}`
  1633.     Push `${_EXCLUDE}`
  1634.     Call un.StrFilter
  1635.     Pop ${_RESULT}
  1636.     !verbose pop
  1637. !macroend
  1638.  
  1639. !macro un.VersionCompareCall _VER1 _VER2 _RESULT
  1640.     !verbose push
  1641.     !verbose ${_WORDFUNC_VERBOSE}
  1642.     Push `${_VER1}`
  1643.     Push `${_VER2}`
  1644.     Call un.VersionCompare
  1645.     Pop ${_RESULT}
  1646.     !verbose pop
  1647. !macroend
  1648.  
  1649. !macro un.VersionConvertCall _VERSION _CHARLIST _RESULT
  1650.     !verbose push
  1651.     !verbose ${_WORDFUNC_VERBOSE}
  1652.     Push `${_VERSION}`
  1653.     Push `${_CHARLIST}`
  1654.     Call un.VersionConvert
  1655.     Pop ${_RESULT}
  1656.     !verbose pop
  1657. !macroend
  1658.  
  1659.  
  1660. !macro un.WordFind
  1661.     !ifndef un.WordFind
  1662.         !verbose push
  1663.         !verbose ${_WORDFUNC_VERBOSE}
  1664.         !undef _WORDFUNC_UN
  1665.         !define _WORDFUNC_UN `un.`
  1666.  
  1667.         !insertmacro WordFind
  1668.  
  1669.         !undef _WORDFUNC_UN
  1670.         !define _WORDFUNC_UN
  1671.         !verbose pop
  1672.     !endif
  1673. !macroend
  1674.  
  1675. !macro un.WordFind2X
  1676.     !ifndef un.WordFind2X
  1677.         !verbose push
  1678.         !verbose ${_WORDFUNC_VERBOSE}
  1679.         !undef _WORDFUNC_UN
  1680.         !define _WORDFUNC_UN `un.`
  1681.  
  1682.         !insertmacro WordFind2X
  1683.  
  1684.         !undef _WORDFUNC_UN
  1685.         !define _WORDFUNC_UN
  1686.         !verbose pop
  1687.     !endif
  1688. !macroend
  1689.  
  1690. !macro un.WordFind3X
  1691.     !ifndef un.WordFind3X
  1692.         !verbose push
  1693.         !verbose ${_WORDFUNC_VERBOSE}
  1694.         !undef _WORDFUNC_UN
  1695.         !define _WORDFUNC_UN `un.`
  1696.  
  1697.         !insertmacro WordFind3X
  1698.  
  1699.         !undef _WORDFUNC_UN
  1700.         !define _WORDFUNC_UN
  1701.         !verbose pop
  1702.     !endif
  1703. !macroend
  1704.  
  1705. !macro un.WordReplace
  1706.     !ifndef un.WordReplace
  1707.         !verbose push
  1708.         !verbose ${_WORDFUNC_VERBOSE}
  1709.         !undef _WORDFUNC_UN
  1710.         !define _WORDFUNC_UN `un.`
  1711.  
  1712.         !insertmacro WordReplace
  1713.  
  1714.         !undef _WORDFUNC_UN
  1715.         !define _WORDFUNC_UN
  1716.         !verbose pop
  1717.     !endif
  1718. !macroend
  1719.  
  1720. !macro un.WordAdd
  1721.     !ifndef un.WordAdd
  1722.         !verbose push
  1723.         !verbose ${_WORDFUNC_VERBOSE}
  1724.         !undef _WORDFUNC_UN
  1725.         !define _WORDFUNC_UN `un.`
  1726.  
  1727.         !insertmacro WordAdd
  1728.  
  1729.         !undef _WORDFUNC_UN
  1730.         !define _WORDFUNC_UN
  1731.         !verbose pop
  1732.     !endif
  1733. !macroend
  1734.  
  1735. !macro un.WordInsert
  1736.     !ifndef un.WordInsert
  1737.         !verbose push
  1738.         !verbose ${_WORDFUNC_VERBOSE}
  1739.         !undef _WORDFUNC_UN
  1740.         !define _WORDFUNC_UN `un.`
  1741.  
  1742.         !insertmacro WordInsert
  1743.  
  1744.         !undef _WORDFUNC_UN
  1745.         !define _WORDFUNC_UN
  1746.         !verbose pop
  1747.     !endif
  1748. !macroend
  1749.  
  1750. !macro un.StrFilter
  1751.     !ifndef un.StrFilter
  1752.         !verbose push
  1753.         !verbose ${_WORDFUNC_VERBOSE}
  1754.         !undef _WORDFUNC_UN
  1755.         !define _WORDFUNC_UN `un.`
  1756.  
  1757.         !insertmacro StrFilter
  1758.  
  1759.         !undef _WORDFUNC_UN
  1760.         !define _WORDFUNC_UN
  1761.         !verbose pop
  1762.     !endif
  1763. !macroend
  1764.  
  1765. !macro un.VersionCompare
  1766.     !ifndef un.VersionCompare
  1767.         !verbose push
  1768.         !verbose ${_WORDFUNC_VERBOSE}
  1769.         !undef _WORDFUNC_UN
  1770.         !define _WORDFUNC_UN `un.`
  1771.  
  1772.         !insertmacro VersionCompare
  1773.  
  1774.         !undef _WORDFUNC_UN
  1775.         !define _WORDFUNC_UN
  1776.         !verbose pop
  1777.     !endif
  1778. !macroend
  1779.  
  1780. !macro un.VersionConvert
  1781.     !ifndef un.VersionConvert
  1782.         !verbose push
  1783.         !verbose ${_WORDFUNC_VERBOSE}
  1784.         !undef _WORDFUNC_UN
  1785.         !define _WORDFUNC_UN `un.`
  1786.  
  1787.         !insertmacro VersionConvert
  1788.  
  1789.         !undef _WORDFUNC_UN
  1790.         !define _WORDFUNC_UN
  1791.         !verbose pop
  1792.     !endif
  1793. !macroend
  1794.  
  1795.  
  1796. # Install. Case sensitive. #
  1797.  
  1798. !macro WordFindSCall _STRING _DELIMITER _OPTION _RESULT
  1799.     !verbose push
  1800.     !verbose ${_WORDFUNC_VERBOSE}
  1801.     Push `${_STRING}`
  1802.     Push `${_DELIMITER}`
  1803.     Push `${_OPTION}`
  1804.     Call WordFindS
  1805.     Pop ${_RESULT}
  1806.     !verbose pop
  1807. !macroend
  1808.  
  1809. !macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  1810.     !verbose push
  1811.     !verbose ${_WORDFUNC_VERBOSE}
  1812.     Push `${_STRING}`
  1813.     Push `${_DELIMITER1}`
  1814.     Push `${_DELIMITER2}`
  1815.     Push `${_NUMBER}`
  1816.     Call WordFind2XS
  1817.     Pop ${_RESULT}
  1818.     !verbose pop
  1819. !macroend
  1820.  
  1821. !macro WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  1822.     !verbose push
  1823.     !verbose ${_WORDFUNC_VERBOSE}
  1824.     Push `${_STRING}`
  1825.     Push `${_DELIMITER1}`
  1826.     Push `${_CENTER}`
  1827.     Push `${_DELIMITER2}`
  1828.     Push `${_NUMBER}`
  1829.     Call WordFind3XS
  1830.     Pop ${_RESULT}
  1831.     !verbose pop
  1832. !macroend
  1833.  
  1834. !macro WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  1835.     !verbose push
  1836.     !verbose ${_WORDFUNC_VERBOSE}
  1837.     Push `${_STRING}`
  1838.     Push `${_WORD1}`
  1839.     Push `${_WORD2}`
  1840.     Push `${_NUMBER}`
  1841.     Call WordReplaceS
  1842.     Pop ${_RESULT}
  1843.     !verbose pop
  1844. !macroend
  1845.  
  1846. !macro WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
  1847.     !verbose push
  1848.     !verbose ${_WORDFUNC_VERBOSE}
  1849.     Push `${_STRING1}`
  1850.     Push `${_DELIMITER}`
  1851.     Push `${_STRING2}`
  1852.     Call WordAddS
  1853.     Pop ${_RESULT}
  1854.     !verbose pop
  1855. !macroend
  1856.  
  1857. !macro WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  1858.     !verbose push
  1859.     !verbose ${_WORDFUNC_VERBOSE}
  1860.     Push `${_STRING}`
  1861.     Push `${_DELIMITER}`
  1862.     Push `${_WORD}`
  1863.     Push `${_NUMBER}`
  1864.     Call WordInsertS
  1865.     Pop ${_RESULT}
  1866.     !verbose pop
  1867. !macroend
  1868.  
  1869. !macro StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  1870.     !verbose push
  1871.     !verbose ${_WORDFUNC_VERBOSE}
  1872.     Push `${_STRING}`
  1873.     Push `${_FILTER}`
  1874.     Push `${_INCLUDE}`
  1875.     Push `${_EXCLUDE}`
  1876.     Call StrFilterS
  1877.     Pop ${_RESULT}
  1878.     !verbose pop
  1879. !macroend
  1880.  
  1881. !macro WordFindS
  1882.     !ifndef WordFindS
  1883.         !verbose push
  1884.         !verbose ${_WORDFUNC_VERBOSE}
  1885.         !undef _WORDFUNC_S
  1886.         !define _WORDFUNC_S `S`
  1887.  
  1888.         !insertmacro WordFind
  1889.  
  1890.         !undef _WORDFUNC_S
  1891.         !define _WORDFUNC_S
  1892.         !verbose pop
  1893.     !endif
  1894. !macroend
  1895.  
  1896. !macro WordFind2XS
  1897.     !ifndef WordFind2XS
  1898.         !verbose push
  1899.         !verbose ${_WORDFUNC_VERBOSE}
  1900.         !undef _WORDFUNC_S
  1901.         !define _WORDFUNC_S `S`
  1902.  
  1903.         !insertmacro WordFind2X
  1904.  
  1905.         !undef _WORDFUNC_S
  1906.         !define _WORDFUNC_S
  1907.         !verbose pop
  1908.     !endif
  1909. !macroend
  1910.  
  1911. !macro WordFind3XS
  1912.     !ifndef WordFind3XS
  1913.         !verbose push
  1914.         !verbose ${_WORDFUNC_VERBOSE}
  1915.         !undef _WORDFUNC_S
  1916.         !define _WORDFUNC_S `S`
  1917.  
  1918.         !insertmacro WordFind3X
  1919.  
  1920.         !undef _WORDFUNC_S
  1921.         !define _WORDFUNC_S
  1922.         !verbose pop
  1923.     !endif
  1924. !macroend
  1925.  
  1926. !macro WordReplaceS
  1927.     !ifndef WordReplaceS
  1928.         !verbose push
  1929.         !verbose ${_WORDFUNC_VERBOSE}
  1930.         !undef _WORDFUNC_S
  1931.         !define _WORDFUNC_S `S`
  1932.  
  1933.         !insertmacro WordReplace
  1934.  
  1935.         !undef _WORDFUNC_S
  1936.         !define _WORDFUNC_S
  1937.         !verbose pop
  1938.     !endif
  1939. !macroend
  1940.  
  1941. !macro WordAddS
  1942.     !ifndef WordAddS
  1943.         !verbose push
  1944.         !verbose ${_WORDFUNC_VERBOSE}
  1945.         !undef _WORDFUNC_S
  1946.         !define _WORDFUNC_S `S`
  1947.  
  1948.         !insertmacro WordAdd
  1949.  
  1950.         !undef _WORDFUNC_S
  1951.         !define _WORDFUNC_S
  1952.         !verbose pop
  1953.     !endif
  1954. !macroend
  1955.  
  1956. !macro WordInsertS
  1957.     !ifndef WordInsertS
  1958.         !verbose push
  1959.         !verbose ${_WORDFUNC_VERBOSE}
  1960.         !undef _WORDFUNC_S
  1961.         !define _WORDFUNC_S `S`
  1962.  
  1963.         !insertmacro WordInsert
  1964.  
  1965.         !undef _WORDFUNC_S
  1966.         !define _WORDFUNC_S
  1967.         !verbose pop
  1968.     !endif
  1969. !macroend
  1970.  
  1971. !macro StrFilterS
  1972.     !ifndef StrFilterS
  1973.         !verbose push
  1974.         !verbose ${_WORDFUNC_VERBOSE}
  1975.         !undef _WORDFUNC_S
  1976.         !define _WORDFUNC_S `S`
  1977.  
  1978.         !insertmacro StrFilter
  1979.  
  1980.         !undef _WORDFUNC_S
  1981.         !define _WORDFUNC_S
  1982.         !verbose pop
  1983.     !endif
  1984. !macroend
  1985.  
  1986.  
  1987. # Uninstall. Case sensitive. #
  1988.  
  1989. !macro un.WordFindSCall _STRING _DELIMITER _OPTION _RESULT
  1990.     !verbose push
  1991.     !verbose ${_WORDFUNC_VERBOSE}
  1992.     Push `${_STRING}`
  1993.     Push `${_DELIMITER}`
  1994.     Push `${_OPTION}`
  1995.     Call un.WordFindS
  1996.     Pop ${_RESULT}
  1997.     !verbose pop
  1998. !macroend
  1999.  
  2000. !macro un.WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  2001.     !verbose push
  2002.     !verbose ${_WORDFUNC_VERBOSE}
  2003.     Push `${_STRING}`
  2004.     Push `${_DELIMITER1}`
  2005.     Push `${_DELIMITER2}`
  2006.     Push `${_NUMBER}`
  2007.     Call un.WordFind2XS
  2008.     Pop ${_RESULT}
  2009.     !verbose pop
  2010. !macroend
  2011.  
  2012. !macro un.WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  2013.     !verbose push
  2014.     !verbose ${_WORDFUNC_VERBOSE}
  2015.     Push `${_STRING}`
  2016.     Push `${_DELIMITER1}`
  2017.     Push `${_CENTER}`
  2018.     Push `${_DELIMITER2}`
  2019.     Push `${_NUMBER}`
  2020.     Call un.WordFind3XS
  2021.     Pop ${_RESULT}
  2022.     !verbose pop
  2023. !macroend
  2024.  
  2025. !macro un.WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  2026.     !verbose push
  2027.     !verbose ${_WORDFUNC_VERBOSE}
  2028.     Push `${_STRING}`
  2029.     Push `${_WORD1}`
  2030.     Push `${_WORD2}`
  2031.     Push `${_NUMBER}`
  2032.     Call un.WordReplaceS
  2033.     Pop ${_RESULT}
  2034.     !verbose pop
  2035. !macroend
  2036.  
  2037. !macro un.WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
  2038.     !verbose push
  2039.     !verbose ${_WORDFUNC_VERBOSE}
  2040.     Push `${_STRING1}`
  2041.     Push `${_DELIMITER}`
  2042.     Push `${_STRING2}`
  2043.     Call un.WordAddS
  2044.     Pop ${_RESULT}
  2045.     !verbose pop
  2046. !macroend
  2047.  
  2048. !macro un.WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  2049.     !verbose push
  2050.     !verbose ${_WORDFUNC_VERBOSE}
  2051.     Push `${_STRING}`
  2052.     Push `${_DELIMITER}`
  2053.     Push `${_WORD}`
  2054.     Push `${_NUMBER}`
  2055.     Call un.WordInsertS
  2056.     Pop ${_RESULT}
  2057.     !verbose pop
  2058. !macroend
  2059.  
  2060. !macro un.StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  2061.     !verbose push
  2062.     !verbose ${_WORDFUNC_VERBOSE}
  2063.     Push `${_STRING}`
  2064.     Push `${_FILTER}`
  2065.     Push `${_INCLUDE}`
  2066.     Push `${_EXCLUDE}`
  2067.     Call un.StrFilterS
  2068.     Pop ${_RESULT}
  2069.     !verbose pop
  2070. !macroend
  2071.  
  2072. !macro un.WordFindS
  2073.     !ifndef un.WordFindS
  2074.         !verbose push
  2075.         !verbose ${_WORDFUNC_VERBOSE}
  2076.         !undef _WORDFUNC_S
  2077.         !undef _WORDFUNC_UN
  2078.         !define _WORDFUNC_UN `un.`
  2079.         !define _WORDFUNC_S `S`
  2080.  
  2081.         !insertmacro WordFind
  2082.  
  2083.         !undef _WORDFUNC_UN
  2084.         !define _WORDFUNC_UN
  2085.         !undef _WORDFUNC_S
  2086.         !define _WORDFUNC_S
  2087.         !verbose pop
  2088.     !endif
  2089. !macroend
  2090.  
  2091. !macro un.WordFind2XS
  2092.     !ifndef un.WordFind2XS
  2093.         !verbose push
  2094.         !verbose ${_WORDFUNC_VERBOSE}
  2095.         !undef _WORDFUNC_UN
  2096.         !define _WORDFUNC_UN `un.`
  2097.         !undef _WORDFUNC_S
  2098.         !define _WORDFUNC_S `S`
  2099.  
  2100.         !insertmacro WordFind2X
  2101.  
  2102.         !undef _WORDFUNC_UN
  2103.         !define _WORDFUNC_UN
  2104.         !undef _WORDFUNC_S
  2105.         !define _WORDFUNC_S
  2106.         !verbose pop
  2107.     !endif
  2108. !macroend
  2109.  
  2110. !macro un.WordFind3XS
  2111.     !ifndef un.WordFind3XS
  2112.         !verbose push
  2113.         !verbose ${_WORDFUNC_VERBOSE}
  2114.         !undef _WORDFUNC_UN
  2115.         !define _WORDFUNC_UN `un.`
  2116.         !undef _WORDFUNC_S
  2117.         !define _WORDFUNC_S `S`
  2118.  
  2119.         !insertmacro WordFind3X
  2120.  
  2121.         !undef _WORDFUNC_UN
  2122.         !define _WORDFUNC_UN
  2123.         !undef _WORDFUNC_S
  2124.         !define _WORDFUNC_S
  2125.         !verbose pop
  2126.     !endif
  2127. !macroend
  2128.  
  2129. !macro un.WordReplaceS
  2130.     !ifndef un.WordReplaceS
  2131.         !verbose push
  2132.         !verbose ${_WORDFUNC_VERBOSE}
  2133.         !undef _WORDFUNC_UN
  2134.         !define _WORDFUNC_UN `un.`
  2135.         !undef _WORDFUNC_S
  2136.         !define _WORDFUNC_S `S`
  2137.  
  2138.         !insertmacro WordReplace
  2139.  
  2140.         !undef _WORDFUNC_UN
  2141.         !define _WORDFUNC_UN
  2142.         !undef _WORDFUNC_S
  2143.         !define _WORDFUNC_S
  2144.         !verbose pop
  2145.     !endif
  2146. !macroend
  2147.  
  2148. !macro un.WordAddS
  2149.     !ifndef un.WordAddS
  2150.         !verbose push
  2151.         !verbose ${_WORDFUNC_VERBOSE}
  2152.         !undef _WORDFUNC_UN
  2153.         !define _WORDFUNC_UN `un.`
  2154.         !undef _WORDFUNC_S
  2155.         !define _WORDFUNC_S `S`
  2156.  
  2157.         !insertmacro WordAdd
  2158.  
  2159.         !undef _WORDFUNC_UN
  2160.         !define _WORDFUNC_UN
  2161.         !undef _WORDFUNC_S
  2162.         !define _WORDFUNC_S
  2163.         !verbose pop
  2164.     !endif
  2165. !macroend
  2166.  
  2167. !macro un.WordInsertS
  2168.     !ifndef un.WordInsertS
  2169.         !verbose push
  2170.         !verbose ${_WORDFUNC_VERBOSE}
  2171.         !undef _WORDFUNC_UN
  2172.         !define _WORDFUNC_UN `un.`
  2173.         !undef _WORDFUNC_S
  2174.         !define _WORDFUNC_S `S`
  2175.  
  2176.         !insertmacro WordInsert
  2177.  
  2178.         !undef _WORDFUNC_UN
  2179.         !define _WORDFUNC_UN
  2180.         !undef _WORDFUNC_S
  2181.         !define _WORDFUNC_S
  2182.         !verbose pop
  2183.     !endif
  2184. !macroend
  2185.  
  2186. !macro un.StrFilterS
  2187.     !ifndef un.StrFilterS
  2188.         !verbose push
  2189.         !verbose ${_WORDFUNC_VERBOSE}
  2190.         !undef _WORDFUNC_UN
  2191.         !define _WORDFUNC_UN `un.`
  2192.         !undef _WORDFUNC_S
  2193.         !define _WORDFUNC_S `S`
  2194.  
  2195.         !insertmacro StrFilter
  2196.  
  2197.         !undef _WORDFUNC_UN
  2198.         !define _WORDFUNC_UN
  2199.         !undef _WORDFUNC_S
  2200.         !define _WORDFUNC_S
  2201.         !verbose pop
  2202.     !endif
  2203. !macroend
  2204.  
  2205. !endif
  2206.